package com.lanou3g.hw0412;

import java.util.Scanner;

/**
 * Created by dllo on 18/4/10.
 */
/*
完成计算器v1.0
1.可以计算俩位整数加减乘除
2.使用流程:
2.1先输入一个数在输入一个数
2.2然后输入操作符(+ - * /)
2.3打印出结果
 */
public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入第一个数:");
        int a = scanner.nextInt();
        System.out.println("请输入第二个数:");
        int b = scanner.nextInt();
        System.out.println("请输入操作符:");
        String op = scanner.next();

        Operator operator = OperatorFactory.getOperator(op);

        Number result = operator.compute(a, b);

        System.out.println("结果是:" + result);
    }

}
